<?php
use yii\filters\ContentNegotiator;
use yii\web\Response;

$params = array_merge(
//    require(__DIR__ . '/../../protected/common/config/params.php'),
    require(__DIR__ . '/../../protected/common/config/params-local.php'),
    require(__DIR__ . '/params.php')
//    require(__DIR__ . '/params-local.php')
);

return [
    'id' => 'mycaigou-search',
    'basePath' => dirname(__DIR__),
    'controllerNamespace' => 'search\controllers',
    'bootstrap' => [
        'iLog',
        [
            'class' => ContentNegotiator::className(),
            'formats' => [
                'application/json' => Response::FORMAT_JSON,
            ],
            'languages' => [
                'zh-CN',
            ],
        ],
    ],
    'modules' => [],
    'components' => [
//        'log' => [
//            'traceLevel' => YII_DEBUG ? 3 : 0,
//            'targets' => [
//                [
//                    'class' => '\common\log\AliLogTarget',
//                    'levels' => ['error', 'warning', 'info'],
//                    'logFile' => (YII_ENV_PROD || YII_ENV == 'mir') ? '/www/logs/platform-application-log/mycaigousearch/app.log' : null,
//                    'categories' => [],
//                    'except' => [
//                        'yii\web\Session::open',
//                        'yii\web\HttpException:404',
//                    ],
//                    'logVars' => ['_GET', '_POST', '_SERVER'],
//                    'maxFileSize' => 10240,
//                ],
//            ],
//        ],
//        'request' => [
//            // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
//            'cookieValidationKey' => 'X3sIK6GG0E_WpJ5yQLTFP3FxMgKx-IJ3',
//        ],
        'request' => [
            'parsers' => [
                'application/json' => 'yii\web\JsonParser',
            ]
        ],
        'errorHandler' => [
            'errorAction' => 'site/error',
        ],
        'urlManager' => require(__DIR__ . '/urlManager.php'),
    ],
    'params' => $params,
];

